package com.tenc.vo;

public enum WechatEnum {
    SUCCESS(0,"请求成功"),
    CODE_1(-1,"系统繁忙"),
    CODE_6000(6000,"数据版本冲突"),
    CODE_40001(40001,"不合法的secret参数"),
    CODE_40003(40003,"无效的UserID"),
    CODE_40004(40004,"不合法的媒体文件类型");


    private final Integer code ;
    private final String message;

    WechatEnum(final Integer code, final String message){
        this.code =code;
        this.message=message;
    }

    public static WechatEnum wechatEnum(int code) {
        WechatEnum[] ecs = WechatEnum.values();
        for (WechatEnum ec : ecs) {
            if (ec.getCode() == code) {
                return ec;
            }
        }
        return SUCCESS;
    }

    public Integer getCode(){
        return code;
    }

    public String getMessage(){
        return message;
    }
}
